﻿using System;
using System.Collections;
using System.Reflection;
using Kratos.Framework.Extensions.RouteExtensions;
using Kratos.Framework.Infrastructures;
using System.Web.Routing;
using System.Web.Mvc;
using Microsoft.Practices.Unity;

namespace Kratos.Modules.MainBlog
{
    public class MainBlogModule : IKratosModule, IKratosDataProvider
    {
        private readonly IUnityContainer _container;

        public MainBlogModule(IUnityContainer container)
        {
            _container = container;
        }

        #region IKratosModule Members

        public void Initialize()
        {

        }

        public void RegisterRoutes(RouteCollection routes)
        {
            var nameSpace = new[] { "Kratos.Modules.MainBlog.Controllers" };
            routes.MapLowerCaseRoute(
                "MainBlog",
                "Blog",
                new { controller = "MainBlog", action = "Index" },
                null,
                nameSpace
                );
        }

        public void RegisterModelBinders(ModelBinderDictionary modelBinders)
        {

        }

        public void RegisterBizServices()
        {

        }

        public void RegisterAction()
        {
            var assembly = Assembly.GetExecutingAssembly();
            SecurityHelper.SetActionByAssembly(assembly);
        }

        public void Unload()
        {

        }

        #endregion

        #region IKratosDataProvider Members

        public void ConfigDataProvider()
        {

        }

        #endregion
    }
}
